<!doctype html>
<html class="no-js">
<head>
	<link rel="stylesheet" href="${rootPath}/assets/css/amazeui.min.css"/>
	<link rel="stylesheet" href="${rootPath}/assets/css/admin.css">
<script type="text/javascript">
//表单提交
function save(){
	if( $( "#roleName" ).val() == '' ) {
		window.top.tips( "角色名称不能为空！" );
		return ;
	}
	if(  $( "#roleCode" ).val() == '' ) {
		window.top.tips( "角色编号，不能为空！" );
		return ;
	}
	var sysRole = $("form").serialize();
	$.post( "${rootPath}/sys/role/edit", sysRole , function ( data ) {
			if ( data.status == 1 ) {
				window.parent.location.href="${rootPath}/sys/role/";
			} else {
				window.top.tips( data.msg );
			}
	}, "json" );
}

</script>
</head>
<body>
<!-- content start -->
<div class="admin-content">
    <div class="am-cf am-padding">
      	<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">修改角色</strong> / <small>Personal information</small></div>
    </div>
    <div class="am-g">
		<form class="am-form am-form-horizontal" id="form-with-tooltip">
			<input type="hidden" value="${sysRole.id}" id="id" name="sysRole.id">
			<div class="am-u-sm-12">	        
		        <div class="am-form-group">
		            <label for="parentName" class="am-u-sm-3 am-form-label">父级角色</label>
		            <div class="am-u-sm-9">
		              	<input type="text" id="parentName" name="sysRole.parentName" value="${sysRole.parentName!'已是最高角色'}" disabled="disabled" >
		            </div>
		        </div>

		        <div class="am-form-group">
		            <label for="roleCode" class="am-u-sm-3 am-form-label">角色编号</label>
		            <div class="am-u-sm-9">
		              	<input type="text" id="roleCode" name="sysRole.roleCode" id="roleCode"  data-foolish-msg="角色编号,不能为空" required value="${sysRole.roleCode}" placeholder="填写角色对应的角色编号">
		            </div>
		        </div>

		        <div class="am-form-group">
		            <label for="roleName" class="am-u-sm-3 am-form-label">角色名称</label>
		            <div class="am-u-sm-9">
		              	<input type="text" id="roleName" name="sysRole.roleName" id="roleName"  data-foolish-msg="角色名称,不能为空" required value="${sysRole.roleName}" placeholder="输入角色名称">
		            </div>
		        </div>
				
		        <div class="am-form-group">
		            <label for="isUsed1" class="am-u-sm-3 am-form-label">是否有效</label>
		            <div class="am-u-sm-9">
		            	 <label class="am-radio-inline">
			                <input type="radio" value="1" ${sysRole.isUsed==1?'checked="checked"':''} name="sysRole.isUsed" > 正常
			            </label>
			            <label class="am-radio-inline">
			                <input type="radio" value="0" ${sysRole.isUsed==0?'checked="checked"':''} name="sysRole.isUsed"> 无效
			            </label>
		            </div>
		        </div>

		         <div class="am-form-group">
		            <div class="am-u-sm-3 am-u-sm-push-3">
		              	<button type="button" onclick="history.go(-1);" class="am-btn am-btn-primary"><span class="am-icon-arrow-left"></span> 返回 </button>
		            </div>
		            
		            <div class="am-u-sm-6">
		              	<button type="button" onclick="save()" class="am-btn am-btn-primary"><span class="am-icon-save"></span> 保存 </button>
		            </div>
		        </div>
	      	</div>
	     </form>
    </div>
</div>
<!-- content end -->

</body>
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="${rootPath}/assets/js/polyfill/rem.min.js"></script>
<script src="${rootPath}/assets/js/polyfill/respond.min.js"></script>
<script src="${rootPath}/assets/js/amazeui.legacy.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${rootPath}/assets/js/jquery.min.js"></script>
<script src="${rootPath}/assets/js/amazeui.min.js"></script>
<!--<![endif]-->
<script src="${rootPath}/assets/js/app.js"></script>
<!-- 校验 -->
<link rel="stylesheet" href="${rootPath}/ext/css/validator-tooltip.css">
<script src="${rootPath}/ext/js/validator-tooltip.js"></script>
</html>
